<!--#include("_header.html")-->
<!--%import("../../tpl/js/shopxe.js")-->

<!--%load_js_plugin("ui.datepicker")-->

<div class="titleBox">
    <div class="subject"><h1><span>주문목록</span></h1></div>
    <div class="memo">
		<span>주문내역을 조회할 수 있고, 취소/교환/반품 신청 내역을 확인하실 수 있습니다.</span>
    </div>
</div>

<div class="lineClear"></div>

<table width="100%" cellpadding="0" cellspacing="0" class="e_point_seacher">
    <tr>
        <th>기간별 조회 : </th>
        <td>
            <input type="hidden" name="created_at" id="created_at" value="{$created_at}" />
            <input type="text" value="{$v_created_at}" readonly="readonly" class="inputDate inputTypeText font_numeric" />
            ~
            <input type="hidden" name="created_at_end" id="created_at_end" value="{$created_at_end}" />
            <input type="text" value="{$v_created_at_end}" readonly="readonly" class="inputDate inputTypeText font_numeric" />
            <a href="#" onClick="location.href=current_url.setQuery('created_at',jQuery('#created_at').val()).setQuery('created_at_end',jQuery('#created_at_end').val());" class="button white"><span>조회</span></a>
        </td>
    </tr>
</table>

<table class="shopList" summary="주문 목록리스트">
<caption>주문 목록리스트</caption>
<colgroup>
    <col width="7%">
    <col width="25%">
    <col width="20%">
    <col width="10%">
    <col width="8%">
    <col width="10%">
    <col width="10%">
    <col width="10%">
</colgroup>
<thead>
<tr>
    <th>주문일자</th>
	<th>상품명</th>
    <th>주문총액</th>
    <th>배송비</th>
    <th>결제총액</th>
    <th>주문상태</th>
    <th>기타</th>
</tr>
</thead>
<tbody>
<!--@if( $purchase_list == null )-->
    <tr height="25">
        <td colspan="7"> 주문내역이 없습니다. </td>
    </tr>
<!--@else-->
    <!--@foreach($purchase_list as $no => $val)-->
    <tr height="25">
        <td>
			{zdate($val->created_at,"Y-m-d")}
			<br/>
			({$val->purchase_srl})
        </td>
        <td>
            <!--@foreach($val->purchase_items as $no1 => $val1)-->
            {@$output_item = $val1->get('item')}
                <div class="cartProduct">

				<!--@if( $val->step > 0 )-->
				<a href="{getUrl('','act','dispShopxePurchaseResult','purchase_srl',$val->purchase_srl)}" >
				<!--@else-->
                <a href="{getUrl('act','dispShopxeInsertPurchase','purchase_srl',$val->purchase_srl)}" >
				<!--@end-->

                <!--@if($output_item->getThumbnail(70,40,'crop') == null)-->
                    <img src="img/common/img_blank.gif" width="70" height="40" />
                <!--@else-->
                    <img src="{$output_item->getThumbnail(70,40,'crop')}" width="70" height="40" />
                <!--@end-->
                {$output_item->get('title')}

                </a>
                </div>
            <!--@end-->
        </td>
        <td>{number_format($val->order_amount)} {$lang->money_unit}</td>
        <td>{number_format($val->delivery_amount)} {$lang->money_unit}</td>
        <td>{number_format($val->order_amount+$val->delivery_amount-$val->discount_amount)} {$lang->money_unit}</td>

        <td>{$paymentState[$val->step]}</td>
        <td>
			<div>
			<a href="{getUrl('','act','dispShopxePurchaseResult','purchase_srl',$val->purchase_srl)}" class="button white" ><span>주문확인</span></a>
            <!--@if( $val->step == 0 )-->
				<!--@if( $val->payment_call != "BK" )-->
				<a href="{getUrl('act','dispShopxeInsertPurchase','purchase_srl',$val->purchase_srl)}" class="button white" ><span>결제하기</span></a>
				<!--@end-->
                <a href="{getUrl('act','dispShopxeDeletePurchase','purchase_srl',$val->purchase_srl)}" class="button white"><span>주문취소</span></a>
            <!--@elseif( $val->step == 1 )-->
                <a href="{getUrl('','mid',$module_info->mid,'act','dispShopxeUpdatePurchaseStep','purchase_srl',$val->purchase_srl,'step',8)}" class="button white"><span>환불신청</span></a>
            <!--@elseif( $val->step == 3 )-->
                <a href="{getUrl('','mid',$module_info->mid,'act','dispShopxeUpdatePurchaseStep','purchase_srl',$val->purchase_srl,'step',4)}" class="button white"><span>수령확인</span></a>
                <a href="{getUrl('','mid',$module_info->mid,'act','dispShopxeUpdatePurchaseStep','purchase_srl',$val->purchase_srl,'step',11)}" class="button white"><span>반품신청</span></a>
                <a href="{getUrl('','mid',$module_info->mid,'act','dispShopxeUpdatePurchaseStep','purchase_srl',$val->purchase_srl,'step',13)}" class="button white"><span>교환신청</span></a>
            <!--@end-->
            </div>
        </td>
    </tr>
    <!--@end-->
<!--@end-->
</tbody>
</table>

<!--@if( $purchase_list != null )-->
<!-- 페이지 네비게이션 -->
<div class="shopPaginate">
    <a href="{getUrl('page','','module_srl','')}" class="prevEnd"><</a> 
    <!--@while($page_no = $page_navigation->getNextPage())-->
        <!--@if($page == $page_no)-->
            <strong>{$page_no}</strong> 
        <!--@else-->
            <a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a> 
        <!--@end-->
    <!--@end-->
    <a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="nextEnd">></a>
</div>
<!--@end-->

<script type="text/javascript">
(function($){
    $(function(){
        var option = { gotoCurrent: false,yearRange:'-100:+10', onSelect:function(){

            $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))}
        };
        $.extend(option,$.datepicker.regional['{$lang_type}']);
        $(".inputDate").datepicker(option);
    });
})(jQuery);
</script>
<!--#include("_footer.html")-->
